/*
 * @Descripttion: 
 * @version: 
 * @Date: 2022-03-14 13:20:11
 * @LastEditTime: 2024-05-13 11:07:08
 * @FilePath: /chengdu-targetcontroller/src/utils/http.ts
 */
import axios from '@/utils/axios';
import configService from '@/utils/config';
const { post, get, jsonp } = axios;

// 获取登录用户信息JWT加密秘钥
export const getJWTKey = (url: string, data: any, showloading: boolean) => get(configService.authorizeKey + url, data, showloading);
// 登录接口
export const loginData = (data: any, showloading: boolean, headers?: string) => post(configService.authorizeKey + configService.login, data, showloading, headers);

export const login4A = (data: any, showloading: boolean, headers?: string) => post(configService.host4A, data, showloading, headers);

// 地图搜索接口
export const searchMap = (data: any, showloading: boolean) => jsonp(configService.baiduSearchHost, data, showloading);

export const geocoder = (data: any, showloading: boolean) => jsonp(configService.geocoder, data, showloading);

export const uploadPositionList = (data: any, showloading: boolean, headers?: string) => post(configService.Host1 + configService.uploadPosition + '?app_token=' + configService.token, data, showloading, headers);


/**
 * 获取版本号
 * @param params 参数
 * @param showloading 是否显示loading框
 * @param callback 回调函数
 */
export const getServerAppInfo = (data: any, showloading: boolean, headers?: string) => post(configService.version + '?app_token=' + configService.token, data, showloading, headers);
/**
 * 获取问题类型
 * @param params 参数
 * @param showloading 是否显示loading框
 * @param callback 回调函数
 */
export const problemsTypesList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.problemsTypesList + '&keyCase=camel', data, showloading, headers);

/**
 * 获取问题类型
 * @param params 参数
 * @param showloading 是否显示loading框
 * @param callback 回调函数
 */
export const regionList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.regionList + '&keyCase=camel', data, showloading, headers);

/**
 * 获取问题类型
 * @param params 参数
 * @param showloading 是否显示loading框
 * @param callback 回调函数
 */
export const countyList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.countyList + '&keyCase=camel', data, showloading, headers);
/**
 * 获取督察级别
 * @param params 参数
 * @param showloading 是否显示loading框
 * @param callback 回调函数
 */
export const dcLevel = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.dcLevel + '&keyCase=camel', data, showloading, headers);

/**
 * 获取现场列表
 * @param params 参数
 * @param showloading 是否显示loading框
 * @param callback 回调函数
 */
export const scHCList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.scHCList + '&keyCase=camel', data, showloading, headers);

export const dclx = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.dclx + '&keyCase=camel', data, showloading, headers);

export const dcTypes = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.dcTypes + '&keyCase=camel', data, showloading, headers);

export const xcjcList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xcjcList + '&keyCase=camel', data, showloading, headers);

export const taskStatus = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.taskStatus + '&keyCase=camel', data, showloading, headers);

export const getLocPostionList = (data: any, showloading: boolean, headers?: string) => post(configService.Host1 + configService.getLocPostion + '?app_token=' + configService.token, data, showloading, headers);

export const pfInfo = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.pfInfo + '&keyCase=camel', data, showloading, headers);

export const taskInfo = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.taskInfo + '&keyCase=camel', data, showloading, headers);

export const cityTbInfo = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.cityTbInfo + '&keyCase=camel', data, showloading, headers);

export const newProblemsList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.newProblemsList + '&keyCase=camel', data, showloading, headers);

export const saveXCHC = (data: any, showloading: boolean, headers?: string) => post(configService.Host1 + configService.saveXCHC, data, showloading, headers);

export const taskStatusNum = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.taskStatusNum + '&keyCase=camel', data, showloading, headers);

export const taskFormData = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.taskFormData, data, showloading, headers);

export const newProblemsTotal = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.newProblemsTotal, data, showloading, headers);

export const newProblemsTypes = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.newProblemsTypes, data, showloading, headers);

export const newProblemsDetail = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.newProblemsDetail, data, showloading, headers);

export const saveProblemsDetail = (data: any, showloading: boolean, headers?: string) => post(configService.Host1 + configService.saveProblemsDetail, data, showloading, headers);

export const saveResource = (data: any, showloading: boolean, headers?: string) => post(configService.Host1 + configService.saveResource, data, showloading, headers);

export const polluteList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.polluteList, data, showloading, headers);

export const productList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.productList, data, showloading, headers);

export const newId = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.newId, data, showloading, headers);

export const deleteFile = (data: any, showloading: boolean, headers?: string) => post(configService.fileHOST + data.fileId + configService.deleteFile, data, showloading, headers);

export const fileList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.fileList, data, showloading, headers);
export const fileList1 = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.fileList1, data, showloading, headers);

export const zgCompleteEchart = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.zgCompleteEchart, data, showloading, headers);
export const zgCompleteText = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.zgCompleteText, data, showloading, headers);

export const zgTaskCount = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.zgTaskCount, data, showloading, headers);

export const dcLvAndDcTable = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.dcLvAndDcTable, data, showloading, headers);
export const xfLvAndDcTable = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xfLvAndDcTable, data, showloading, headers);
export const dcLvAndDcEchart = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.dcLvAndDcEchart, data, showloading, headers);

export const yjAndZcRate = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.yjAndZcRate, data, showloading, headers);
export const yjAndZcNum = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.yjAndZcNum, data, showloading, headers);

export const xjRate = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xjRate, data, showloading, headers);
export const xjNum = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xjNum, data, showloading, headers);

export const rwzsPoint = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.rwzsPoint, data, showloading, headers);
export const hcgzList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.hcgzList, data, showloading, headers);
export const hcgzPoint = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.hcgzPoint, data, showloading, headers);

export const xzCount = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xzCount, data, showloading, headers);

/**
 * 整改阶段类型
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const zgTypes = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.zgTypes + '&keyCase=camel', data, showloading, headers);

/**
 * 督察轮次下拉数据
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const superviseRoundTypes = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.superviseRoundTypes + '&keyCase=camel', data, showloading, headers);

/**
 * 央督措施列表
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const ydMeasureList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.ydMeasureList, data, showloading, headers);

/**
 * 省督措施列表
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const sdMeasureList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.sdMeasureList, data, showloading, headers);

/**
 * 长江、黄河措施列表
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const riverMeasureList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.riverMeasureList, data, showloading, headers);

/**
 * 新建问题措施列表
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const newQuestionMeasureList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.newQuestionMeasureList, data, showloading, headers);

/**
 * 信访措施列表
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const xfMeasureList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xfMeasureList, data, showloading, headers);

// 细化措施详情--------------------开始
/**
 * 省任务整改措施-央督例行
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const ydlxTaskMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.ydlxTaskMeasure, data, showloading, headers);

/**
 * 省任务整改措施-省督例行
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const sdlxTaskMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.sdlxTaskMeasure, data, showloading, headers);

/**
 * 省任务整改措施-央督、省督信访
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const xfTaskMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xfTaskMeasure, data, showloading, headers);

/**
 * 省任务整改措施-长江黄河
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const cjhhTaskMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.cjhhTaskMeasure, data, showloading, headers);

/**
 * 省任务整改措施-新建问题
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const xjwtTaskMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xjwtTaskMeasure, data, showloading, headers);

/**
 * 细化措施信息-央督例行
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const ydlxRefineMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.ydlxRefineMeasure, data, showloading, headers);

/**
 * 细化措施信息-省督例行
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const sdlxRefineMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.sdlxRefineMeasure, data, showloading, headers);

/**
 * 细化措施信息-新建问题
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const xjwtRefineMeasure = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.xjwtRefineMeasure, data, showloading, headers);

/**
 * 细化措施详情-填报信息
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const fillInfo = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.fillInfo, data, showloading, headers);

/**
 * 细化措施详情-历史填报信息
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const historyFillInfo = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.historyFillInfo, data, showloading, headers);

/**
 * 细化措施详情-现场核查信息
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const liveCheckInfo = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.liveCheckInfo, data, showloading, headers);

/**
 * 细化措施详情-现场核查信息-附件
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const liveCheckInfoFileData = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.liveCheckInfoFileData + '&keyCase=camel', data, showloading, headers);

/**
 * 细化措施详情-调整记录
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const adjustRecords = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.adjustRecords, data, showloading, headers);

// 细化措施详情--------------------结束


export const getTaskList = (data: any, showloading: boolean, type: 'xjwtTask' | 'zcfxTask' | 'gjyjTask' | 'xfTask' | 'sdlxTask' | 'ydlxTask', headers?: string) => {
                                        console.log(configService[type], type);
                                        const interfaceId = configService[type];
                                        return post(configService.Host + '?token=' + configService.token + '&interfaceId=' + interfaceId, data, showloading, headers)
};
/**
 * 细化措施详情-人员轨迹经纬度数据
 * @param {any} data 参数
 * @param {boolean} showloading 是否显示loading框
 * @param {string} headers
 */
export const personTracks = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.personTracks + '&keyCase=camel', data, showloading, headers);
// 细化措施详情--------------------结束

export const dictionaryData = (data: any, interfaceId: 'RECTIFICATION_SJTJ' | 'PROBLEM_BATCH' | 'Q_TYPE', showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService[interfaceId] + '&keyCase=camel', data, showloading, headers);
// 中央督察-任务基本信息
export const yd_detail = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.yd_detail + '&keyCase=camel', data, showloading, headers);
// 中央督察-是否销号
export const yd_xh = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.yd_xh + '&keyCase=camel', data, showloading, headers);
// 中央督察-销号附件
export const yd_files = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.yd_files + '&keyCase=camel', data, showloading, headers);
// 责任单位
export const zrdw = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.zrdw + '&keyCase=camel', data, showloading, headers);
// 省级督察-任务基本信息
export const sj_detail = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.sj_detail + '&keyCase=camel', data, showloading, headers);

export const qycomplete = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.qycomplete + '&keyCase=camel', data, showloading, headers);

export const fwqx = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.fwqx + '&keyCase=camel', data, showloading, headers);

export const homeModelTime = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.homeModelTime + '&keyCase=camel', data, showloading, headers);

export const pointList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.pointList + '&keyCase=camel', data, showloading, headers);

export const regionPointList = (data: any, showloading: boolean, headers?: string) => post(configService.Host + '?token=' + configService.token + '&interfaceId=' + configService.regionPointList + '&keyCase=camel', data, showloading, headers);